﻿<div>
    <p>Are you sure you want to delete the record?</p>

    <button @onclick="Yes" class="btn btn-outline-danger">Yes</button>
    <button @onclick="No" class="btn btn-primary">No</button>
</div>

@code {

    [CascadingParameter] BlazoredModalInstance BlazoredModal { get; set; } = default!;
    [CascadingParameter] private IModalService Modal { get; set; } = default!;

    async Task Yes()
    {
        var confirmationModal = Modal.Show<Confirm>("Second Modal");
        var result = await confirmationModal.Result;

        if (result.Cancelled)
            return;

        await BlazoredModal.CloseAsync();
    }

    async Task No() => await BlazoredModal.CloseAsync();

}
